var imgs = ["image/0.png", "image/1.png", "image/2.png", "image/3.png", "image/4.png"];
var index = 0;

function change() {

    var img = document.getElementById("img_main");
    img.src = imgs[index++];
    if (index >= 5) {
        index = 0;
    }
}

setInterval("change()", 3000);

function goShop(id) {
    window.top.location.href = "../GoShopServlet?id=" + id;
}

function goAllShop() {
    window.top.location.href = "allShop.jsp";
}